package edu.pku.sei.act.sampletask.car;

import java.util.ArrayList;

import edu.pku.sei.act.actools.util.TaskMessage;
import edu.pku.sei.act.sampletask.AutonomicParking;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.RemoteException;
import android.util.Log;

public class _MarkParkingSlot extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		ArrayList<CharSequence> result = intent.getCharSequenceArrayListExtra("result");
		TaskMessage msg = new TaskMessage(result.get(0).toString());
		Log.v("_MarkParkingSlot", "marking at:" + msg.getContent());
		try {
			AutonomicParking.setState(_Car.state.STOPPED);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
	}

}
